home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / SOUND / MP3CONV.ZIP / !MP3Conv / h / decoder < prev    next >
Text File  |  1997-03-31  |  8KB  |  190 lines

  1. /**********************************************************************
  2.  * ISO MPEG Audio Subgroup Software Simulation Group (1996)
  3.  * ISO 13818-3 MPEG-2 Audio Decoder - Lower Sampling Frequency Extension
  4.  *
  5.  * $Id: decoder.h,v 1.2 1996/03/28 03:13:37 rowlands Exp $
  6.  *
  7.  * $Log: decoder.h,v $
  8.  * Revision 1.2  1996/03/28 03:13:37  rowlands
  9.  * Merged layers 1-2 and layer 3 revisions
  10.  *
  11.  * Revision 1.1  1996/02/14 03:45:52  rowlands
  12.  * Initial revision
  13.  *
  14.  * Received from FhG
  15.  **********************************************************************/
  16. /**********************************************************************
  17.  *   date   programmers         comment                               *
  18.  * 2/25/91  Doulas Wong,        start of version 1.0 records          *
  19.  *          Davis Pan                                                 *
  20.  * 5/10/91  Vish (PRISM)        Renamed and regrouped all ".h" files  *
  21.  *                              into "common.h" and "decoder.h".      *
  22.  *                              Ported to Macintosh and Unix.         *
  23.  * 27jun91  dpwe (Aware)        New prototype for out_fifo()          *
  24.  *                              Moved "alloc_*" stuff to common.h     *
  25.  *                              Use ifdef PROTO_ARGS for prototypes   *
  26.  *                              prototypes reflect frame_params struct*
  27.  * 10/3/91  Don H. Lee          implemented CRC-16 error protection   *
  28.  * 2/11/92  W. Joseph Carter    Ported new code to Macintosh.  Most   *
  29.  *                              important fixes involved changing     *
  30.  *                              16-bit ints to long or unsigned in    *
  31.  *                              bit alloc routines for quant of 65535 *
  32.  *                              and passing proper function args.     *
  33.  *                              Removed "Other Joint Stereo" option   *
  34.  *                              and made bitrate be total channel     *
  35.  *                              bitrate, irrespective of the mode.    *
  36.  *                              Fixed many small bugs & reorganized.  *
  37.  *                              Modified some function prototypes.    *
  38.  * 08/07/92 Mike Coleman        Made small changes for portability    *
  39.  * 9/07/93  Toshiyuki Ishino    Integrated with Layer III.            *
  40.  * 11/04/94 Jon Rowlands        fix protos for usage() and            *
  41.  *                              recover_CRC_error()                   *
  42.  *          Roland Bitto     Adapted to MPEG2 low bitrate          *
  43.  * 12/16/96 Johan Hagman    Adapted for Solaris (mpeg3play 0.9)   *
  44.  **********************************************************************/
  45.  
  46. /***********************************************************************
  47. *
  48. *  Decoder Include Files
  49. *
  50. ***********************************************************************/
  51.  
  52. /***********************************************************************
  53. *
  54. *  Decoder Definitions
  55. *
  56. ***********************************************************************/
  57.  
  58. #define   DFLT_OPEXT        ".dec"  /* default output file name extension */
  59. /*
  60.  NOTE: The value of a multiple-character constant is
  61.  implementation-defined.
  62. */
  63. #if !defined(MS_DOS) && !defined(AIX)
  64. #define   FILTYP_DEC_AIFF   'AIFF'
  65. #define   FILTYP_DEC_BNRY   'TEXT'
  66. #define   CREATR_DEC_AIFF   'Sd2a'
  67. /*
  68.   The following character constant is ASCII '?+?+?+?'
  69.   It is declared in hex because the character
  70.   constant contains a trigraph, causing an error in
  71.   parsing with ANSI preprocessors.
  72. */
  73. #define   CREATR_DEC_BNRY   0x3f3f3f3f
  74. #else
  75. #define   FILTYP_DEC_AIFF   "AIFF"
  76. #define   FILTYP_DEC_BNRY   "TEXT"
  77. #define   CREATR_DEC_AIFF   "Sd2a"
  78. #define   CREATR_DEC_BNRY   "????"
  79. #endif
  80.  
  81. #define   SYNC_WORD         (long) 0xfff
  82. #define   SYNC_WORD_LNGTH   12
  83.  
  84. #define   MUTE              0
  85.  
  86. /***********************************************************************
  87. *
  88. *  Decoder Type Definitions
  89. *
  90. ***********************************************************************/
  91.  
  92. /***********************************************************************
  93. *
  94. *  Decoder Variable External Declarations
  95. *
  96. ***********************************************************************/
  97.  
  98. /***********************************************************************
  99. *
  100. *  Decoder Function Prototype Declarations
  101. *
  102. ***********************************************************************/
  103.  
  104. /* The following functions are in the file "decode.c" */
  105.  
  106. #ifdef   PROTO_ARGS
  107. extern void   decode_info(Bit_stream_struc*, frame_params*);
  108. extern void   II_decode_bitalloc(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  109.                        frame_params*);
  110. extern void   I_decode_bitalloc(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  111.                        frame_params*);
  112. extern void   I_decode_scale(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  113.                        unsigned int[2][3][SBLIMIT], frame_params*);
  114. extern void   II_decode_scale(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  115.                        unsigned int[2][SBLIMIT], unsigned int[2][3][SBLIMIT],
  116.                        frame_params*);
  117. extern void   I_buffer_sample(Bit_stream_struc*, unsigned int[2][3][SBLIMIT],
  118.                        unsigned int[2][SBLIMIT], frame_params*);
  119. extern void   II_buffer_sample(Bit_stream_struc*, unsigned int[2][3][SBLIMIT],
  120.                        unsigned int[2][SBLIMIT], frame_params*);
  121. extern void   II_dequantize_sample(unsigned int[2][3][SBLIMIT], 
  122.                        unsigned int[2][SBLIMIT], REAL[2][3][SBLIMIT],
  123.                        frame_params*);
  124. extern void   I_dequantize_sample(unsigned int[2][3][SBLIMIT],
  125.                        REAL[2][3][SBLIMIT], unsigned int[2][SBLIMIT],
  126.                        frame_params*);
  127. extern void   II_denormalize_sample(REAL[2][3][SBLIMIT],
  128.                        unsigned int[2][3][SBLIMIT], frame_params*, int);
  129. extern void   I_denormalize_sample(REAL[2][3][SBLIMIT],
  130.                        unsigned int[2][3][SBLIMIT], frame_params*);
  131. extern void   create_syn_filter(REAL[64][SBLIMIT]);
  132. extern int    SubBandSynthesis (REAL*, int, short*);
  133. extern void   read_syn_window(REAL[HAN_SIZE]);
  134. extern void   out_fifo(short[2][SSLIMIT][SBLIMIT], int, frame_params*, int,
  135.                        FILE*, unsigned long*);
  136. extern void   buffer_CRC(Bit_stream_struc*, unsigned int*);
  137. extern void   recover_CRC_error(short[2][SSLIMIT][SBLIMIT], int, frame_params*,
  138.                        FILE*, unsigned long*);
  139. extern void   III_dequantize_sample(long int[SBLIMIT][SSLIMIT],
  140.             REAL [SBLIMIT][SSLIMIT], III_scalefac_t *,
  141.                         struct gr_info_s *, int, frame_params *);
  142. extern void   III_antialias(REAL[SBLIMIT][SSLIMIT], REAL[SBLIMIT][SSLIMIT], 
  143.             struct gr_info_s *, frame_params *);
  144. extern void   inv_mdct(REAL[18], REAL[36], int);
  145. extern void   III_hybrid(REAL[SSLIMIT], REAL[SSLIMIT] , int, int,
  146.             struct gr_info_s *, frame_params *);
  147. extern void   III_get_side_info(Bit_stream_struc *, III_side_info_t *,
  148.             frame_params *);
  149. extern void   III_get_scale_factors(III_scalefac_t *, III_side_info_t *,
  150.             int, int, frame_params *);
  151. extern void   III_get_LSF_scale_factors(III_scalefac_t *, III_side_info_t *,
  152.             int, int, frame_params *);
  153. extern void   III_hufman_decode(long int [SBLIMIT][SSLIMIT],
  154.             III_side_info_t    *, int, int, int, frame_params *);
  155. extern void   III_stereo(REAL [2][SBLIMIT][SSLIMIT], REAL [2][SBLIMIT][SSLIMIT],
  156.             III_scalefac_t *, struct gr_info_s *, frame_params *);
  157. extern void   III_reorder(REAL [SBLIMIT][SSLIMIT], REAL [SBLIMIT][SSLIMIT],
  158.             struct gr_info_s *, frame_params *);
  159. extern void   initialize_huffman();
  160. extern void   rewindNbits(int);
  161. extern int main_data_slots(frame_params);
  162.  
  163. #else
  164. extern void   decode_info();
  165. extern void   II_decode_bitalloc();
  166. extern void   I_decode_bitalloc();
  167. extern void   I_decode_scale();
  168. extern void   II_decode_scale();
  169. extern void   I_buffer_sample();
  170. extern void   II_buffer_sample();
  171. extern void   read_quantizer_table();
  172. extern void   II_dequantize_sample();
  173. extern void   I_dequantize_sample();
  174. extern void   read_scale_factor();
  175. extern void   II_denormalize_sample();
  176. extern void   I_denormalize_sample();
  177. extern void   create_syn_filter();
  178. extern int    SubBandSynthesis ();
  179. extern void   read_syn_window();
  180. extern void   window_sample();
  181. extern void   out_fifo();
  182. extern void   buffer_CRC();
  183. extern void   recover_CRC_error();
  184. extern void   III_dequantize_sample();
  185. extern void   III_antialias();
  186. extern void   inv_mdct();
  187. extern void   III_hybrid();
  188. extern int    main_data_slots();
  189. #endif
  190.